#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
# Filename @ timeslong.py
# Author @ Huoty
# Create date @ 2014-10-16 09:37:52
# Description @ 
# *************************************************************

import time
 
def timeslong(func):
    def call():
        start = time.clock()
        print "It's time starting ! "
        func()
        print "It's time ending ! "
        end = time.clock()
        return "It's used : %s ." % (end - start)
    return call

# Script starts from here

@timeslong
def f():
    y = 0
    for i in range(10):
        y = y + i + 1
        time.sleep(0.5)
        print y
    return y
print f()

